<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
	<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/font-awesome.min.css" rel="stylesheet">
<link href="./css/animate.min.css" rel="stylesheet">
<link href="./css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="./css/plugins/summernote/summernote-bs3.css"
	rel="stylesheet">
<link href="./css/style.min.css" rel="stylesheet">
<link href="./css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
<script src="./js/My97DatePicker/WdatePicker.js"></script>
<script src="./js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="./js/jquery.min.js"></script>
<script type="text/javascript" src="./js/img_upload.js"></script>
<script type="text/javascript" src="./js/fileUploadUtil.js"></script>
<script src="./js/demo/form-validate-demo.min.js"></script>
<script src="./js/plugins/validate/messages_zh.min.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="./js\demo\form-employeevalidate.js"></script>
<script src="js/common.js"></script>
<title>滨海基金 -修改员工信息</title>
</head>
<body class="gray-bg">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>
						修改员工信息
					</h5>
					<div class="ibox-tools">
						<a class="btn  btn-sm btn-bitbucket" href="javascript:void(0);" onclick="history.back()"> <i
							class="fa fa-reply"></i> 主页
						</a>
					</div>
				</div>
	
				<div class="ibox-content">
					<form method="post" action="insertEmployee.do"  
	class="form-horizontal m-t" id="employeeForm" enctype="multipart/form-data">
						<div class="row form-body form-horizontal m-t">
							<div class="col-md-6 droppable sortable">
						
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">员工姓名：
									</label>
									<div class="col-sm-8">
										<input type="text" name="name" id="name"
											class="form-control" placeholder="请输入员工姓名" value="${emp.name }">
									</div>
								</div>
							<%-- 	<div class="form-group draggable">
									<label class="col-sm-3 control-label">密码：</label>
									<div class="col-sm-8">
									
										 	<input id="password" name="password"
										class="form-control" type="password" value="${emp.password }">
										
									</div>
								</div> --%>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">性别：
									
									</label>
									<div class="col-sm-8">
									
									
										<label class="radio-inline"> <input type="radio"
										<c:if test="${emp.sex eq '男' }">checked=""</c:if>	 value="男" id="optionsRadios1" name="sex">男
										</label> <label class="radio-inline"> <input type="radio"
											<c:if test="${emp.sex eq '女' }">checked=""</c:if> value="女" id="optionsRadios2" name="sex">女
										</label>
									</div>
								</div>
									<div class="form-group draggable">
									<label class="col-sm-3 control-label">角色：
									</label>
									<div class="col-sm-8">
										<select class="form-control" name="rid">
											<option value="">-请选择角色-</option>
											<c:forEach items="${requestScope.roleList }" var="role">
												<option <c:if test="${emp.role.id eq role.id }">selected=""</c:if>  value="${role.id }">${role.rname }</option>
												
											</c:forEach>
											
										</select>	
									</div>
								</div>
							
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">所在部门：
									</label>
									<div class="col-sm-8">
										
											
										<select class="form-control" name="deptId">
											<option value="">-请选择部门-</option>
											<c:forEach items="${requestScope.departmentList }" var="dept">
											<option <c:if test="${emp.dept.deptId eq dept.deptId }">selected=""</c:if> value="${dept.deptId }">${dept.deptName }</option>
											</c:forEach>
										</select>	
											
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">手机号码：</label>
									<div class="col-sm-8">
										<input type="text" name="phoneNumber" id="phoneNumber"
											class="form-control" placeholder="请输入手机号码" value="${emp.phoneNumber }">
									</div>
								</div>
							
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">职务：</label>
									<div class="col-sm-8">
											<input type="text" name="position" class="form-control"
											placeholder="请输入职务" value="${emp.position }" >
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">电子邮箱：
									</label>
									<div class="col-sm-8">
										<input type="text" name="email" id="email"
											class="form-control" placeholder="请输入电子邮箱"  value="${emp.email }">
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-3 control-label">工作年限 ：
									</label>
									<div class="col-sm-8">
										<input type="text" name="serviceYear" class="form-control"
											onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd '})"
											placeholder="请输入工作年限"  value="<fmt:formatDate value="${emp.serviceYear }" type="date"/>"    >
									</div>
								</div>

							</div>
							<div class="col-md-6 droppable sortable">
								<div class="form-group draggable">
									<label class="col-sm-2 control-label">身份证号码：</label>
									<div class="col-sm-8">
										<input type="text" name="idCard" id="idCard"
											class="form-control" placeholder="请输入身份证号码" value="${emp.idCard }">
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-2 control-label">出生日期：</label>
									<div class="col-sm-8">
											<input type="text" name="birthday" class="form-control"
											onClick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd '})"
											placeholder="请输入出生日期"  value="<fmt:formatDate value="${emp.birthday }" type="date"/>">
									</div>
								</div>
								
								<div class="form-group draggable">
									<label class="col-sm-2 control-label">住址：</label>
									<div class="col-sm-8">
										<input type="text" name="address" id="address"
											class="form-control" placeholder="请输入住址" value="${emp.address }">
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-2 control-label">在职情况：</label>
									<div class="col-sm-8">
										
											<select class="form-control" name="workConditions">
												<option <c:if test="${emp.workConditions==0 }">	selected</c:if> value="0">上班中</option>
												<option <c:if test="${emp.workConditions==1 }">selected</c:if> value="1">休假中</option>
												<option <c:if test="${emp.workConditions==2 }">selected</c:if> value="2">请假中</option>
											</select>
											
											
									</div>
								</div>
								<div class="form-group draggable">
									<label class="col-sm-2 control-label">是否在职：</label>
									<div class="col-sm-8">
									
									<select class="form-control"  name="status">
										<option <c:if test="${emp.status==0 }">	selected</c:if> value="0">是</option>
										<option <c:if test="${emp.status==1 }">	selected</c:if> value="1">否</option>
									</select>
									
									
										
									</div>
								</div>
								
								<%-- <div class="form-group draggable">
									<label class="col-sm-2 control-label">头像：</label>
									<div class="col-sm-8">
										
											<img alt="" src="${emp.picture }" width="150px" height="120px">
							<input type="file"  name="hotelImgFile" id="hotelImgFile"
							class="form-control" multiple="multiple" value="更换头像">
										 <input type="hidden" name="picture" id="picture" />
									</div>
								</div> --%>
								
							</div>
						</div>
						<p align="center">
						<input type="hidden" name="operation" value="修改">
						<input type="hidden" name="employeeId" value="${emp.employeeId }">
							<button type="submit" class="btn btn-info" id="btnSubmit">修改</button>
						</p>
					</form>
				</div>
				
			</div>
		</div>
		<script type="text/javascript">
		$(function(){
			
			//选择头像之后的事件
			$("#hotelImgFile").change(function(){
				var file=$("#hotelImgFile");
				
				var suffix=file.val().substring(file.val().lastIndexOf(".")+1,file.val().length);
				var picture=file.val().substring(file.val().lastIndexOf("\\")+1,file.val().length);
				
				var imageSize=file[0].files[0].size/1024;//kb
				suffix=suffix.toLowerCase();
				//JPG,JPEG,PNG,BMP,GIF格式
				if(suffix!="jpg"&&suffix!="jpeg"&&suffix!="png"&&suffix!="bmp"&&suffix!="gif"){
					file.val("");//清空
					sweetAlert("提示", "仅支持10M以下JPG,JPEG,PNG,BMP,GIF格式图片!", "error");
				}else if(imageSize>1024*5){  //仅支持5M内的图片
					file.val("");//清空
					sweetAlert("提示", "图片文件的大小不能超过5M!", "error");
				}else{
					$("#picture").val(file.val());
				}
				
				
				
			});
			
			
			
		})
			
		</script>
</body>
</html>